package com.tgu.home_action.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel(description = "分页对象")
public class Page<T> {
    @ApiModelProperty("当前页")
    private Integer pageNo;
    @ApiModelProperty("每页条数")
    private Integer pageSize;
    @ApiModelProperty("总页数")
    private Integer pageNum;
    @ApiModelProperty("数据总数")
    private Integer totalCount;
    @ApiModelProperty("数据")
    private List<T> data;

    public Page(Integer pageNo, Integer pageSize, Integer pageNum, Integer totalCount) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.pageNum = pageNum;
        this.totalCount = totalCount;
    }

    public Page(Integer pageNo, Integer pageSize, Integer pageNum, Integer totalCount, List<T> data) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.pageNum = pageNum;
        this.totalCount = totalCount;
        this.data = data;
    }

    public Page() {
    }
}
